@import '../../core/stylesheets/variables.scss';

.md-dialog-container {
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 108;

  &.md-active {
    pointer-events: auto;

    .md-dialog {
      opacity: 1 !important;
      transform: scale(1) !important;
      transition: $swift-ease-out;
      transition-property: opacity, transform;
    }
  }
}

.md-dialog-backdrop {
  position: fixed;
  z-index: 109;
}

.md-dialog {
  min-width: 280px;
  max-width: 80%;
  max-height: 80%;
  display: flex;
  flex-flow: column;
  overflow: hidden;
  position: relative;
  z-index: 110;
  outline: none;
  border-radius: 2px;
  opacity: 0;
  box-shadow: $material-shadow-14dp;
  transform: scale(.9, .85);
  transform-origin: center center;
  transition: opacity $swift-ease-out-duration $swift-ease-out-timing-function,
              transform $swift-ease-out-duration .05s $swift-ease-out-timing-function;
  will-change: opacity, transform;

  &.md-reference {
    transform-origin: top center;
  }

  &.md-transition-off {
    transition: none !important;
  }

  p {
    margin: 0;
  }
}

.md-dialog-title {
  margin-bottom: 20px;
  padding: 24px 24px 0;
}

.md-dialog-content {
  padding: 0 24px 24px;
  flex: 1;
  flex-basis: auto;
  overflow: auto;
  position: relative;
  background: linear-gradient(to bottom, #fff 0, #fff 1px, transparent 1px),
              linear-gradient(to top, #fff 0, #fff 3px, transparent 3px),
              linear-gradient(to bottom, rgba(#000, .12) 0, rgba(#000, .12) 1px, transparent 1px),
              linear-gradient(to top, rgba(#000, .2) 1px, rgba(#000, .2) 2px, transparent 2px);
  background-attachment: local, local, scroll, scroll;

  &:first-child {
    padding-top: 24px;
  }

  p:first-child:not(:only-child) {
    margin-top: 0;
  }

  p:last-child:not(:only-child) {
    margin-bottom: 0;
  }
}

.md-dialog-body {
  margin: 0 -24px;
  padding: 0 24px;
  overflow: auto;
}

.md-dialog-actions {
  min-height: 52px;
  padding: 8px 8px 8px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;

  &:before {
    height: 1px;
    position: absolute;
    top: -1px;
    right: 0;
    left: 0;
    background-color: #fff;
    content: " ";
  }

  .md-button {
    min-width: 64px;
    margin: 0;
    padding: 0 8px;

    + .md-button {
      margin-left: 8px;
    }
  }
}
